Refactor Libraryimport/phase 2#7560
Merged
JoonghyunCho merged 9 commits intoSamsung:mainfrom Apr 14, 2026
Merged
Conversation
70179c1 to
341046c
Compare
added 9 commits
April 14, 2026 17:55
Convert DllImport declarations to LibraryImport (source-generated P/Invoke) for the following modules: - Tizen.Applications: Common, DataControl, PackageManager, Notification, NotificationEventListener, Shortcut, Cion, ComponentBased, WatchfaceComplication, WidgetControl, UIGadget, UnitedService - Tizen.Content: Download, MediaContent - Tizen.Security Changes: - Apply [LibraryImport] and StringMarshalling.Utf8 - Add [MarshalAs(UnmanagedType.U1)] for bool parameters - Safely cherry-picked keeping new additions in main (e.g. Discovery) - Filter.cs excluded due to SafeHandle out parameter generation limits
- Fix double [MarshalAs] on 'out bool' params in RPCPort.cs (3 instances) - Add StringMarshalling.Utf8 to string-returning methods in AppCommon.cs (SYSLIB1051) - Fix 'partial unsafe' → 'unsafe partial' keyword order in Bundle.cs (CS0267)
…convert residual DllImport - Remove 26 redundant StringMarshalling.Utf8 from methods without string params - Convert DevicePolicyManager.PasswordGetExpires from DllImport to LibraryImport
Reverted to avoid merge conflicts when both PRs land.
Account.* (41 files → Phase 3), Network.* (27 files → Phase 4) modules were inadvertently included from the source commit. Reverted to main to ensure zero overlap between all Phase branches.
DllImport uses 4-byte BOOL by default (matching C's int/bool). Adding [MarshalAs(UnmanagedType.U1)] changes it to 1-byte, causing ABI mismatch with native Tizen C APIs. MarshalAs(U1) is only needed for LibraryImport which has no default bool marshalling.
…ope) Reverted [return: MarshalAs(UnmanagedType.U1)] on delegate bool returns and [MarshalAs(UnmanagedType.U1)] on delegate bool params across 14 files. These changes require separate ABI analysis and should be in their own PR.
…tion CRITICAL: The conversion script removed [DllImport] but failed to add [LibraryImport] due to [In]/[In,Out] struct parameters, leaving orphan extern methods without any P/Invoke attribute. This causes EntryPointNotFoundException at runtime — likely root cause of Authenticator.MakeCredential() TCT failure.
Reverted: Tizen.Content.Download, Tizen.Security.WebAuthn, Tizen.Security.SecureRepository, Tizen.Applications.Shortcut
eb4cea9 to
a9b1c34
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate
DllImporttoLibraryImport(source-generated P/Invoke) for medium-risk modules.This is Phase 2 of 4 in a staged LibraryImport migration. It covers Applications, Security modules while carefully preserving recent features (e.g.,
DiscoveryinRPCPort) and handling delegate/SafeHandle constraints.Modules Changed (57 files)
Changes
[DllImport]to[LibraryImport]and updated method signatures tostatic partial.stringparams withStringMarshalling = StringMarshalling.Utf8only where strictly needed.[MarshalAs(UnmanagedType.U1)].partial unsafe→unsafe partialkeyword order in Bundle.cs.StringMarshalling.Utf8to 14 string-returning methods in AppCommon.cs.mainfeatures likeInterop.LibRPCPort.Discoveryunmodified while converting the rest of the file.What is NOT included
Tizen.Applications.ComponentBased—BaseMain,BaseAddFrameComponent,BaseAddServiceComponentremain asDllImportdue torefstruct callback parameters.Tizen.Applications.UI—ui_app_mainremains asDllImportdue toref UIAppLifecycleCallbacksstruct callback.boolMarshalAs improvements — extracted for an independent PR.TCT Verification